<?php keke_tpl_class::checkrefresh('tpl/default/ajax/payitem', '1459869831' );?>
<form action="index.php?do=payitem" method="post" name="payitemForm" id="payitemForm" role="form">
<div class="modal-body">
<input type="hidden" name="formhash" id="formhash" value="<?php echo FORMHASH;?>"> <input type="hidden" name="objId" id="objId" value="<?php echo $objId?>"> <input type="hidden" name="type" id="type" value="<?php echo $type?>">
<table class="table table-hover form-inline">
<thead>
<tr>
<th width="13%">增值工具</th>
<th width="30%">购买说明</th>
<th></th>
<th width="20%">价格</th>
</tr>
</thead>
<tbody>
<?php if(is_array($arrPayitemLists)) { foreach($arrPayitemLists as $k => $v) { ?>
<tr id="tr_balace">
<input type="hidden" name="code" value="<?php echo $v['item_code']?>" >
<td><label for="checkbox_<?php echo $v['item_code'];?>"> <input type="checkbox" id="checkbox_<?php echo $v['item_code'];?>" name="txt_<?php echo $v['item_code'];?>" data-unit-price="<?php echo $v['item_cash'];?>" value="1" data-code="<?php echo $v['item_code'];?>" <?php if($v['buystatus'] =='已购买此项增值服务') { ?> disabled="disabled"<?php } ?>> <span class="marked <?php echo $v['style']?>"><?php echo $v['abbr']?></span>
</label></td>
<td><?php echo $v['exttips'];?><br/><?php if($v['item_code']=='tasktop' ||$v['item_code']=='goodstop') { ?><?php if($v['buystatus']) { ?> <?php echo $v['buystatus']?> <?php } ?><?php } ?></td>
<td><?php if($v['item_code']=='tasktop' ||$v['item_code']=='goodstop') { ?>
<div class="form-group hidden div_<?php echo $v['item_code'];?>">
<?php if(!$v['buystatus']||$k=='tasktop'||$k=='goodstop') { ?> 追加天数：<input type="text" name="text_<?php echo $v['item_code'];?>" data-unit-price="<?php echo $v['item_cash'];?>" data-code="<?php echo $v['item_code'];?>" class="form-control input-sm" id="text_<?php echo $v['item_code'];?>" placeholder="数量" style="width: 80px" onkeyup="clearstr(this);" autocomplete="off" maxlength="2"><input type="hidden"  name="text_day" id="text_day"> <?php } ?>
</div> <?php } ?>
</td>
<td><?php if($v['buystatus']!='已购买此项增值服务' ) { ?><span class="money"><sub>￥</sub><?php echo $v['item_cash']?> 元 / <?php echo $v['item_standard']?></span><?php } else { ?>已购买<?php } ?></td>
</tr>
<?php } } ?>
</tbody>
<tfoot>
<tr>
<td></td>
<td></td>
<td></td>
<td><div id="blance_total" class="hidden">合计：<span class="money lead"><sub>￥</sub><span id="payitem-costs">0</span></span></div></td>
</tr>
</tfoot>
</table>
</div>
<div class="modal-footer">
<a class="btn btn-primary hidden" id="check_balance">立即支付</a>
<a class="btn btn-primary" id="clo_se1">确定</a>
<div class="hidden" id="balance_pay">
<div class="form-group row">
<label class="col-sm-2 control-label form-control-static">支付密码：</label>
<div class="col-sm-4 text-left">
<input type="password" name="zfpwd" id="zfpwd" placeholder="请输入支付密码" class="form-control">
</div>

<div class="col-sm-6">
<a id="clo_se" class="btn btn-danger">放弃支付</a>
<button type="submit" value="1" class="btn btn-primary" id="btn-payitempay" disabled="disabled">确定支付</button>
<!-- <button type="submit" name="submit" class="btn btn-danger">确定支付</button> -->
</div>
</div>
</div>
</div>
</form>
<script type="text/javascript" src="static/js/model/payitem/payitem.js"></script>
<script type="text/javascript">
$(function() {
$("#check_balance").click(function() {
$('#balance_pay').removeClass('hidden');
$(this).addClass('hidden');
});
$('#clo_se').click(function() {
$('.close').trigger('click');
});
$('#clo_se1').click(function() {
$('.close').trigger('click');
});
//提交验证
$('#payitemForm').scojs_valid({
rules : {
text_tasktop: [ 'not_empty',{regex: /^([1-9]?|1\d?|2[0-9]?|30?)$/}],
zfpwd : [ 'not_empty' ]
},
messages : {
text_tasktop : {
not_empty : "请输入追加天数",
regex:'你输入的追加天数从0-30天'
},
zfpwd : {
not_empty : "请输入支付密码"
}
},
wrapper : '.form-group',
onSuccess : function(response, validator) {
tipsOp(response.data);
if (response.url) {
window.location.href = response.url;
}
}
});
});
</script>
<?php keke_tpl_class::ob_out();?>